-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve object_store docs #4978
Conversation
0b14d77
to
e274581
Compare
e274581
to
8826bb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great document! Inspired me a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it -- thank you @tustvold -- very nice. 👏
I have a bunch of small editorial improvement suggestions but nothing that I think would prevent this PR from merging as is
object_store/src/lib.rs
Outdated
//! | ||
//! 3. Stable and predictable governance via the [Apache Arrow] project. | ||
//! 3. Support for advanced functionality, including [ACID] reads |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest you don't use ACID here as it is a database term and not as commonly applied to object stores in my experience.
For example, I think the claim that the D in ACID for Durable counts as "advanced" functionality for object stores / their APIs is confusing. It is also unclear to me what this crates adds for Isolation
in the classic database sense of the word.
Perhaps a better term would be "atomic reads/writes" which also highlights the feature I think you are hinting at
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to allude that you could build ACID transactions on top, but fair enough will change
object_store/src/lib.rs
Outdated
//! | ||
//! 4. Stable and predictable governance via the [Apache Arrow] project | ||
//! | ||
//! 5. Very low dependency footprint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! 5. Very low dependency footprint | |
//! 5. Small dependency footprint (depends on only a small number of common crates) |
object_store/src/lib.rs
Outdated
//! # Why not a Filesystem Interface? | ||
//! | ||
//! Whilst this crate does provide a [`BufReader`], the [`ObjectStore`] interface mirrors the APIs | ||
//! of object stores and not filesystems. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might help to give an example of what a filesystem API means. Perhaps something like
//! of object stores and not filesystems. | |
//! of object stores and not filesystems. For example, it purposely does not offer a `Seek` like API. |
object_store/src/lib.rs
Outdated
//! A common pattern, especially when reading structured datasets, is to need to fetch | ||
//! multiple ranges of a particular object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! A common pattern, especially when reading structured datasets, is to need to fetch | |
//! multiple ranges of a particular object. | |
//! A common pattern, especially when reading structured datasets, is to fetch | |
//! multiple, potentially discontiguous, ranges of a particular object. |
object_store/src/lib.rs
Outdated
//! Ok(match self.entries.get_mut(path) { | ||
//! Some(e) => match e.refreshed_at.elapsed() < Duration::from_secs(10) { | ||
//! true => e.data.clone(), // Return cached data | ||
//! false => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! false => { | |
//! false => { // check if remote version has changed |
object_store/src/lib.rs
Outdated
//! e.data.clone() | ||
//! } | ||
//! }, | ||
//! None => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! None => { | |
//! None => { // not cached, fetch value |
object_store/src/lib.rs
Outdated
//! | ||
//! # Conditional Put | ||
//! | ||
//! The default behaviour when writing data is to upsert any existing object at the given path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! The default behaviour when writing data is to upsert any existing object at the given path. | |
//! The default behaviour when writing data is to upsert any existing object at the given path, overwriting any previous values. |
//! # Arc::new(InMemory::new()) | ||
//! # } | ||
//! # fn do_update(b: Bytes) -> Bytes {b} | ||
//! # async fn conditional_put() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be helpful to have this name exposed
//! # async fn conditional_put() { | |
//! async fn conditional_put() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to add a comment
object_store/src/lib.rs
Outdated
//! // Attempt to commit transaction | ||
//! match store.put_opts(&path, new, PutMode::Update(version).into()).await { | ||
//! Ok(_) => break, // Successfully committed | ||
//! Err(Error::Precondition { .. }) => continue, // Transaction conflict, try again |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! Err(Error::Precondition { .. }) => continue, // Transaction conflict, try again | |
//! Err(Error::Precondition { .. }) => continue, // object has been changed, try again |
17275b6
to
0bcc2a2
Compare
Which issue does this PR close?
Closes #3888
Relates to #4922 (review)
Part of #4879
Rationale for this change
This works on improving the docs for object_store, with a particular view to:
What changes are included in this PR?
Are there any user-facing changes?